package com.mdinfo.system.param;

import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;
import java.util.Date;

/**
 * Created by Administrator on 2017/11/22.
 */
public class MenuParam {

    @Data
    public static class ListQueryParam{
        @NotNull(message = "不能为空")
        @Min(value = 0,message = "最小值为0")
        private Integer start;

        @NotNull(message = "不能为空")
        @Max(value = 50,message = "最大值为50")
        private Integer num;

        private String key;
    }

    @Data
    public static class UsableParam{
        @NotNull(message = "不能为空")
        @Min(value = 1,message = "最小值为1")
        private Integer menuId;
    }

    @Data
    public static class DisableParam{
        @NotNull(message = "不能为空")
        @Min(value = 1,message = "最小值为1")
        private Integer menuId;
    }

    @Data
    public static class DeleteParam{
        @NotNull(message = "不能为空")
        @Min(value = 1,message = "最小值为1")
        private Integer menuId;
    }

    @Data
    public static class AddParam{

        @NotNull(message = "不能为空")
        private String name;        //名称

        @NotNull(message = "不能为空")
        private String tag;         //标识

        @NotNull(message = "不能为空")
        @Range(min = 1,max = 3,message = "大小为1-3")
        private Integer type;       //类型(1:目录,2:菜单,3:按钮)

        private String url;         //菜单url

        @NotNull(message = "不能为空")
        @Min(value = 0,message = "最小值为0")
        private Integer pid;        //父id

        @Min(value = 1, message = "最小值为1")
        private Integer orderNum;   //排序号

        private String icon;        //目录图标
    }

    @Data
    public static class ModifyParam{
        @NotNull
        @Min(1)
        private Integer menuId;
        @NotNull
        private String name;        //名称
        @NotNull
        private String tag;         //标识
        @NotNull
        @Range(min = 1,max = 3)
        private Integer type;        //类型(1:目录,2:菜单,3:按钮)
        private String url;         //菜单url
        @NotNull
        @Min(0)
        private Integer pid;        //父id

        @NotNull
        @Min(1)
        private Integer orderNum;   //排序号
        private String icon;        //目录图标
    }
}
